Wireless M-Bus to NB-IoT - Configuration Messages
Guide to the communication protocol of the wireless M-Bus to NB-IoT converters ACR-CV-1xxNI-W-D2 and ACR-CV-1xxNI-W433-D2.
Introduction
This manual describes a use of the following Lua script Lua script which sets up a protocol to communicate with the ACRIOS NI-W-D converter and a server configured for this purpose. The system makes use of various payload messages (uplink and downlink) that enable both data gathering and device configuration.
First, we look at general principles used in this communication protocol, then there is an overview of uplink messages (device → server communication), then there is an overview of downlink messages (server → device communication) and finally there is a full example of communication between an ACR-CV unit and the server along with an explanation.
Payload
The communication between the device and the server is achieved with help of payload messages. The payload messages are sent in two directions.
- Uplink Message
- This message type is sent from the converter to the server with the requested information.
- Downlink Message
- This message type is sent from the server to the converter with specific commands.
Uplink Command Bytes
| Command Byte | Description |
|---|---|
| 0xFF | Gather report (Legacy) |
| 0xFE | Configuration acknowledge |
| 0xFD | wM-Bus IDs acknowledge |
| 0xFB | Scanning done |
| 0xFA | Status report |
| 0xF9 | Bootloader request |
| 0xF7 | Bootloader answer |
| 0xF6 | wM-Bus IDs checksum |
| 0xF4 | Gather report acked |
| 0xF3 | Scanned unit with mode report |
| 0xF2 | Status report extended |
| 0xF1 | Error report |
| 0xF0 0xFF | Beacon report |
| 0xF0 0xFE | Send once data |
| 0xF0 0xFD | Send once end of gathering |
| 0xF0 0xFC | Sontex ID acknowledge |
| 0xF0 0xFB | Send Sontex frame |
| 0xF0 0xFA | Send number of Sontex IDs |
| 0xF0 0xF9 | Sontex scan finished |
| 0xF0 0xF8 | Scan report with payload |
| 0xF0 0xF7 | BUP key readout |
| 0xF0 0x00 | Data report with ACRCOM |
Downlink Command Bytes
| Command Byte | Description |
|---|---|
| 0x01 | Send IDs |
| 0x02 | Send config |
| 0x03 | Request config |
| 0x04 | Request scan |
| 0x05 | Request IDs |
| 0x06 | Request status |
| 0x07 | Request reset |
| 0x08 | Downlink send ack |
| 0x09 | Specified Error Report |
| 0x0A | Error Report |
| 0x0B | Planned gathering |
| 0x0C | Set Sontex list of IDs |
| 0x0D | Request Sontex ID checksum |
| 0x0E | Request Sontex scan |
| 0x0F | Request scan with payload |
| 0x10 | Set Sensus BUP key |
| 0x11 | Get Sensus BUP key |
Communication Diagrams
This section outlines communication essential for various configurations such as ID readout, encryption keys in BUP mode, and other processes described further below. Every process is clearly depicted and explained through UML diagrams.
Configuration
The primary purpose of downlink communication is remote configuration of the target device. Configuration messages are sent in response to specific messages received from the uplink device. Keep in mind that not all the messages qualify for a response. Downlink messages are only processed when they respond to the following uplink messages:
- 0xF4
- 0xF0 0xFF
- 0xF0 0xFA
- 0xF0 0xF9
- 0xFB
- 0xF1 (specifically when triggered by command 0x0A)
- 0xF0 0xFD
General Configuration
This diagram explains a configuration procedure following a beacon message.
If the device is not configured, it sends a 0xF4 0x01 gather report message. Without a filter of IDs set, the converter will automatically send an uplink every hour to open a receive window for a possible downlink.
Setting IDs
- Wireless M-Bus devices
Below is a diagram showing a process of Wireless M-Bus ID configuration.
- Sontex devices
Configuring Sontex devices involves scanning configured IDs, unlike with the usual Wireless M-Bus devices. This difference is caused by the need of these meters to receive a request for a specified meter ID , in other words, there is a need for active communication, rather than gathering frames passively sent by the meters (passive communication). The benefit of the extra scan in the configuration procedure is that the meter's availability is ensured.
Setting BUP Keys
This section covers the procedures for setting and retrieving BUP (Bubble Up Protocol) keys. Further explanation can be found in the diagrams below.
BUP is a communication protocol used by Sensus/Xylem water meters (MeiStream, iPerl). The communication is encrypted, and if the decryption key is provided, the ACR-CV device can verify the integrity of received frames. Without the decryption key, the ACR-CV cannot verify the integrity and checksum of received BUP messages. Therefore, the key is required.
Note that if an empty key is set, the default BUP Sensus key is used.
Set BUP Key
The following diagram showcases how the process of setting the BUP key works.
Get BUP Key
The following diagram showcases how the process of getting the BUP key works.
Gathering Modes
In addition to specific communication configurations, the Lua scripts available for this device allow for three different approaches to scheduled gathering:
- Multimode: This mode is managed by the server, this mode operates using the following Lua script. Once a configuration message is received from the server, the device enters scheduled gathering mode. It regularly sends beacon messages to maintain communication with the server. In response, the server calculates the necessary interval until the next gathering session and sends a scheduled gathering message back to the device, which then waits until the next gathering session.
Pros
- You can set-up an exact list od IDs with help of Wireless M-Bus ID filter.
- This way, the readout cycle can terminate sooner and does not send any unwanted meter data.
Cons
- It is required to send the configuration from the server.
-
SendOnce: This mode is manually configured directly in the following Lua script. This script works similarly to "Multimode" but does not require server for configuration:
workdayOnly = true -- true for workdays only, false for all days
numberOfDays = 3 -- the number of days/workdays since the end of month
startHour = 10 -- an hour of the start of the readout
randomizeSeconds = 7200 -- up to 7200s~2hrs of delayed start since startHour
Pros
- The Lua script contains the configuration itself, therefore there is no need for configuration from the server.
- The device sends data from every meter in its range.
Cons
- There is no option to configure Wireless M-Bus ID filter.
- The readout cycle may take longer, because it scans for data from meter for an exactly specified amount of time.
-
Periodic Wake-Up: This mode is used by default when no specific gathering schedule is configured. Both of the Lua scripts use a predefined interval to wake up periodically:
pDaysDef = 7 -- days
pHrsDef = 0 -- hours
pMinsDef = 0 -- minutesIn the meantime, the device sends beacon messages to maintain connectivity.
You can look at the following diagram for a simple representation of how the gathering modes differ.
Scheduled Gathering
The diagram below showcases how the device regularly sends beacon messages to maintain communication with the server. In response, the server calculates the necessary interval until the next gathering session and sends a "Planned gathering" message back to the device, which then waits until the next gathering session.
Passive Gathering
Passive gathering is often used by:
- standard Wireless M-Bus devices
- Apator Metra
- Sensus
- BUP and others
Active Gathering
Sontex devices, which are using protocol Radian, are among devices that use active gathering. This protocol requires query-response type of communication and for that reason it is called "Active".
In Active gathering, the 0xF4 report is sent with an empty list of IDs.
Combination of Both Active and Passive Gathering
Both Active and Passive types of gathering are combined in this case. The difference is that the device maintains two separate lists of IDs for Passive and Active gathering, and the devices using Passive gathering are processed first, while devices using the Active gathering are processed last. For further details, see the diagram below.
Scanning for Devices
There are two approaches to scanning: Passive and Active. Passive Wireless M-Bus devices send data frames periodically, whereas Active devices, such as Sontex, require a request before they transmit data. The diagrams below showcase the communication between the server and the device.
-
Wireless M-Bus devices
The unit scans for nearby wM-Bus IDs and sends its device ID, RSSI, and manufacturer ID to the server/backend. This feature is used for automatic allocation based on RSSI or general ID sniffing.
-
Sontex devices
Sontex devices require a request for a specific ID to receive a response; therefore, the list of IDs must be sent in combination with the scan command. See the section here and diagram below.
Uplink Command Bytes
This section provides description for uplink messages that are the individual payloads sent by the converter to the server.
Data Report
This is a periodic report sent by the converter, where the first byte defines the local Wireless M-Bus ID followed by raw data from the Wireless M-Bus device.
Each device is limited to 240 local Wireless M-Bus IDs in range from 0 (0x00) to 127 (0xF0)
| Example | Description | Size | Byte Number |
|---|---|---|---|
| 0x01 | Local wM-Bus ID | [1B] | 1 |
| 0xXX | Raw device data | [xB] | 2 |
Gather Report (0xFF) (Legacy)
This command gathers report for number of devices (N). The report is sent after every scanning cycle and includes information about which ID was found and which was not.
Note that this command is marked as Legacy. It is used only in the older versions of the Lua script.
Payload Description
| Example | Description | Size | Byte Number |
|---|---|---|---|
| 0xFF | Command byte | [1B] | 1 |
| 0x01 | ID1 was found | [1B] | 2 |
| 0x01 | ID2 was found | [1B] | 3 |
| 0x00 | ID3 was not found | [1B] | 4 |
| 0x01 | ID4 was found | [1B] | 5 |
| 0xXX | xxxxxx | [NxB] | 6 |
0x01 = IDs received
0x00 = IDs not found